package com.kun.demo.action;


import com.kun.demo.service.IQueryService;
import com.kun.spring.framework.annotation.FKAutowired;
import com.kun.spring.framework.annotation.FKController;
import com.kun.spring.framework.annotation.FKRequestMapping;
import com.kun.spring.framework.annotation.FKRequestParam;
import com.kun.spring.framework.webmvc.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * 公布接口url
 * @author Tom
 *
 */
@FKController
@FKRequestMapping("/")
public class PageAction {

    @FKAutowired
    IQueryService queryService;

    @FKRequestMapping("/first.html")
    public ModelAndView query(@FKRequestParam("teacher") String teacher){
        String result = queryService.query(teacher);
        Map<String,Object> model = new HashMap<String,Object>();
        model.put("teacher", teacher);
        model.put("data", result);
        model.put("token", "123456");
        return new ModelAndView("first.html",model);
    }

}
